package com.example.emailWeb.Socket.Proxy;

import com.example.emailWeb.ntru.polynomial.IntegerPolynomial;

import java.io.Serializable;

public class PolySocketData implements Serializable {
    private static final long serialVersionUID = 12143029447070001L;
    public boolean fileOwner,requester,fileServer;
    public String fileOwnerEmail,fileRequesterEmail;
    public int keyOrder;
    public IntegerPolynomial a,r1,b;
    public IntegerPolynomial CA,CB;
    public boolean RkabFinish; //重代理密钥生成完毕
    public boolean keyExchange,encry;
    public String fileName;

    public PolySocketData(PolySocketData polySocketData,boolean fileOwner, IntegerPolynomial a ,IntegerPolynomial r1) {
        this(polySocketData);
        this.fileOwner = fileOwner;
        this.a = a;
        this.r1 = r1;
        keyExchange = true;
    }

    public PolySocketData(PolySocketData polySocketData,boolean requester, IntegerPolynomial b) {
        this(polySocketData);
        this.requester = requester;
        this.b = b;
        keyExchange = true;
    }

    public PolySocketData(String fileName, String fileRequesterEmail,String fileOwnerEmail,int keyOrder) {
        this.fileName = fileName;
        this.fileOwnerEmail = fileOwnerEmail;
        this.fileRequesterEmail = fileRequesterEmail;
        this.keyOrder = keyOrder;
        requester = true;
        keyExchange = true;
    }

    public PolySocketData(PolySocketData polySocketData) {
        this.fileName = polySocketData.fileName;
        this.fileOwnerEmail = polySocketData.fileOwnerEmail;
        this.fileRequesterEmail = polySocketData.fileRequesterEmail;
        this.keyOrder = polySocketData.keyOrder;
    }

    @Override
    public String toString() {
        return "PolySocketData{" +
                "fileOwner=" + fileOwner +
                ", requester=" + requester +
                ", fileServer=" + fileServer +
                ", fileOwnerEmail='" + fileOwnerEmail + '\'' +
                ", fileRequesterEmail='" + fileRequesterEmail + '\'' +
                ", keyOrder=" + keyOrder +
                ", a=" + a +
                ", r1=" + r1 +
                ", b=" + b +
                ", CA=" + CA +
                ", CB=" + CB +
                ", RkabFinish=" + RkabFinish +
                ", keyExchange=" + keyExchange +
                ", encry=" + encry +
                ", fileName='" + fileName + '\'' +
                '}';
    }
}
